<?php
/**
 * Create by Phpstorm
 * User: Peco
 * Date: 2019/12/18
 * Time: 22:27
 */


namespace App\Http\Transformers\Setting;

use App\Models\Settings;
use League\Fractal\TransformerAbstract;

class GetAliSettingTransformer extends TransformerAbstract
{
    public function transform(Settings $settings)
    {
        $data = $settings->toArray();

        $value = \GuzzleHttp\json_decode($data['value'], true);

        data_set($value, 'key', $data['key']);

        return $value;
    }
}
